package br.ucb.servlets.cliente;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.ucb.dao.ClienteDAO;
import br.ucb.entidade.Cliente;
import br.ucb.service.ClienteService;
import br.ucb.service.impl.ClienteServiceImpl;
import br.ucb.servlets.AbstractPapirosServlet;

@SuppressWarnings("serial")
public class PesquisarClientesServlet extends AbstractPapirosServlet<Cliente, ClienteService, ClienteDAO>{

	@Override
	protected void processaRequisicao(HttpServletRequest req,
			HttpServletResponse resp) throws ServletException, IOException {
		
		setEntidadeService(new ClienteServiceImpl());
		List<Cliente> clientes = getEntidadeService().findAll();
		req.setAttribute("clientes", clientes);
		forward(req, resp, "/jsp/restrito/listarClientes.jsp");
		
	}

}
